// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial

TestCase := Rectangle {
    width: 400phx;
    height: 400phx;
    forward-focus: input1;

    input1 := TextInput {
        width: parent.width;
        height: 200phx;
    }
    input2 := TextInput {
        y: 200phx;
        width: parent.width;
        height: 200phx;
    }

    property<bool> input1_focused: input1.has_focus;
    property<string> input1_text: input1.text;
    property<bool> input2_focused: input2.has_focus;
    property<string> input2_text: input2.text;
}

/*
```rust
let instance = TestCase::new().unwrap();
assert!(instance.get_input1_focused());
assert!(!instance.get_input2_focused());

slint_testing::send_keyboard_string_sequence(&instance, "Only for field 1");
assert_eq!(instance.get_input1_text(), "Only for field 1");
assert_eq!(instance.get_input2_text(), "");

slint_testing::send_mouse_click(&instance, 150., 100.);
assert!(instance.get_input1_focused());
assert!(!instance.get_input2_focused());

slint_testing::send_mouse_click(&instance, 150., 300.);
assert!(!instance.get_input1_focused());
assert!(instance.get_input2_focused());
```

```cpp
auto handle = TestCase::create();
const TestCase &instance = *handle;
assert(instance.get_input1_focused());
assert(!instance.get_input2_focused());

slint_testing::send_keyboard_string_sequence(&instance, "Only for field 1");
assert_eq(instance.get_input1_text(), "Only for field 1");
assert_eq(instance.get_input2_text(), "");

slint_testing::send_mouse_click(&instance, 150., 100.);
assert(instance.get_input1_focused());
assert(!instance.get_input2_focused());

slint_testing::send_mouse_click(&instance, 150., 300.);
assert(!instance.get_input1_focused());
assert(instance.get_input2_focused());
```

```js
var instance = new slint.TestCase();
assert(instance.input1_focused);
assert(!instance.input2_focused);

instance.send_keyboard_string_sequence("Only for field 1");
assert.equal(instance.input1_text, "Only for field 1");
assert.equal(instance.input2_text, "");

instance.send_mouse_click(150., 100.);
assert(instance.input1_focused);
assert(!instance.input2_focused);

instance.send_mouse_click(150., 300.);
assert(!instance.input1_focused);
assert(instance.input2_focused);
```
*/
